var toyApp=angular.module('toyApp');
toyApp.controller('normalCtl', [
	'$state',
	'$scope',
	'$rootScope',
	function($state,$scope,$rootScope){

		$scope.setactivity=function(type){

        if(type=='wish'){
        	
        	$rootScope.iswish=true;
        	$rootScope.isorderback=false;
        	$rootScope.isshelves=false;
        	$rootScope.isapplyreturn=false;
        }
        else if(type=='orderback'){
        	$rootScope.iswish=false;
        	$rootScope.isorderback=true;
        	$rootScope.isshelves=false;
        	$rootScope.isapplyreturn=false;
        }
        else if(type=='shelves'){
    		$rootScope.iswish=false;
        	$rootScope.isorderback=false;
        	$rootScope.isshelves=true;
        	$rootScope.isapplyreturn=false;
        }
        else{
        	$rootScope.iswish=false;
        	$rootScope.isorderback=false;
        	$rootScope.isshelves=false;
        	$rootScope.isapplyreturn=true;
        }
	}
    
 	$scope.redirectwishlist=function(){
 		$scope.setactivity('wish');
		$state.go('index.wish');

	};
	$scope.redirectorderback=function(){
		$scope.setactivity('orderback');
		$state.go('index.orderback');
	}
	$scope.redirectshelves=function(){
		$scope.setactivity('shelves');
		$state.go('index.shelves');
	}
	$scope.redirectapplyreturn=function(){
		$scope.setactivity('applyreturn');
		$state.go('index.applyreturn');
	}


	

}]);


